package com.lingshu.app.network;

import android.app.Application;

import com.lingshu.app.utils.APKVersionCodeUtils;

/**
 * @author 于定金
 * @version 1.0
 * @Date 2023/12/28 16:40
 * @Description
 */
public class NetworkRequiredInfo implements INetworkRequiredInfo {
    private final Application application;

    public NetworkRequiredInfo(Application application) {
        this.application = application;
    }

    /**
     * 版本名
     */
    @Override
    public String getAppVersionName() {
        return APKVersionCodeUtils.getVerName(application.getApplicationContext());
    }

    /**
     * 版本号
     */
    @Override
    public String getAppVersionCode() {
        return String.valueOf(APKVersionCodeUtils.getVersionCode(application.getApplicationContext()));
    }

    /**
     * 是否为debug
     */
    @Override
    public boolean isDebug() {
        return false;
    }

    /**
     * 应用全局上下文
     */
    @Override
    public Application getApplicationContext() {
        return application;
    }
}